<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/11/28 0028
 * Time: 17:04
 */

namespace logicmodel\award;


class Manage extends Award
{
    private $award_id;
    public function __construct()
    {
        parent::__construct();
        $this->award_id  = 2;
    }

    /**
     * 代理作品奖励
     * @param $uid
     * @param $money
     * @param $from_uid
     * @param $remark
     * @param $goods_id
     * @return bool
     * @throws \think\Exception
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function award($uid,$money,$from_uid,$remark,$goods_id){
        $awardInfo =  $this->awardIsOpen($this->award_id);
        if($awardInfo === false) return false;
        $this->record($uid,1,$money,$from_uid,$this->award_id,$awardInfo['name'],$remark,$awardInfo['field'],$goods_id);
        return true;
    }

}